package rmiserver.service;

import java.util.ArrayList;
import java.util.List;

public class DefaultFileSharing {

	private static volatile DefaultFileSharing singleton_;
	
	private List<String> sharedFiles;
	
	public DefaultFileSharing() {
		setSharedFiles(new ArrayList<String>());
	}

	public static DefaultFileSharing getInstance() {
		DefaultFileSharing result = singleton_;
		if (result == null) {
			synchronized (DefaultFileSharing.class) {
				result = singleton_;
				if (result == null) {
					result = new DefaultFileSharing();
					singleton_ = result;
				}
			}
		}

		return result;
	}

	public void setSharedFiles(List<String> sharedFiles) {
		this.sharedFiles = sharedFiles;
	}

	public List<String> getSharedFiles() {
		return sharedFiles;
	}

}
